/*
 * Copyright 2010 - 2011, The PLDesktop Development Team
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 */

#include "colorvga16.h"

PLColorVGA16 PLColorVGA16::black = PLColorVGA16(PLColorVGA16::Black, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::blue = PLColorVGA16(PLColorVGA16::Blue, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::green = PLColorVGA16(PLColorVGA16::Green, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::cyan = PLColorVGA16(PLColorVGA16::Cyan, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::red = PLColorVGA16(PLColorVGA16::Red, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::magenta = PLColorVGA16(PLColorVGA16::Magenta, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::orange = PLColorVGA16(PLColorVGA16::Orange, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::lightGrey = PLColorVGA16(PLColorVGA16::LightGrey, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::darkGrey = PLColorVGA16(PLColorVGA16::DarkGrey, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::lightBlue = PLColorVGA16(PLColorVGA16::LightBlue, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::lightGreen = PLColorVGA16(PLColorVGA16::LightGreen, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::lightCyan = PLColorVGA16(PLColorVGA16::LightCyan, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::lightRed = PLColorVGA16(PLColorVGA16::LightRed, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::lightMagenta = PLColorVGA16(PLColorVGA16::LightMagenta, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::yellow = PLColorVGA16(PLColorVGA16::Yellow, PLColorVGA16::Black);
PLColorVGA16 PLColorVGA16::white = PLColorVGA16(PLColorVGA16::White, PLColorVGA16::Black);

PLColorVGA16::PLColorVGA16() : m_color(White), m_backgroundColor(Black) {
}

PLColorVGA16::PLColorVGA16(const PLColorVGA16 &c) : m_color(c.m_color), m_backgroundColor(c.m_backgroundColor) {
}

PLColorVGA16::PLColorVGA16(PLColorVGA16::Colors16 c) : m_color(c), m_backgroundColor(Black) {
}

PLColorVGA16::PLColorVGA16(PLColorVGA16::Colors16 c, PLColorVGA16::Colors16 bc) : m_color(c), m_backgroundColor(bc) {
}

PLColorVGA16::operator PLColorVGA16::Colors16() {
	return m_color;
}

PLColorVGA16::operator uint8_t() {
	return (m_backgroundColor << 4) | (m_color & 0x0F);
}
